Our Project Euler group consists of Molly, Kayla and Lindsey. We decided to solve Euler problems 17, 20 and 48. The solutions for each of these problems are listed below.
Click the link below to visit the Project Euler website. Project Euler
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used? NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage.
Solution:
We used Excel to organize and solve this Euler problem. Below is the explanation and the link to the Excel document.
Numbers 1-9 First look at the sum of the number of letters in the numbers 1 through 9 because these numbers are used over and over again. This sum is 36.
Numbers 10-19 Then look at numbers 10-19. The sum of these is 70.
Numbers 20-99 For numbers 20-99 there is a pattern. Each section of ten numbers has the same prefix (for example, twenty, thirty.... before the suffix). Then multiply ten by the number of letters in each number. Add 36 for each set of ten (eight in total). The sum of numbers 20-99 is 748. So the sum of the letters in the numbers 1-99 is 854.
Numbers 100-999 Then look at the numbers 100-999 which also have a pattern. Hundred has 7 letters, so add seven to the number of letters in the number of the hundred (for example: 200(two hundred) is 3+7=10). Then multiply that number by 100 since it will be used 100 times. Then add 3*99*9, this value accounts for the three letters in the word "and" for the numbers 101-999 without counting 200, 300, 400, 500, 600, 700, 800, and 900. Then add 854*9 to account for the numbers 1-99 in each of the 9 hundreds that we have.
So for example, 100-199 the total is 2151 letters which comes from (7+3)*100 (the hundreds column)+3*99 (the "ands")+854 (the ones and tens column). Do this same process for all of the hundreds and add them together to get 20259. Then add that to the previous 854 (numbers 1-99) to get 21113. For the last number,1000, add 11 letters to the running total which gives you 21,124.
Final total of letters in the numbers 1 to 1000 is 21,124.
n! means n*(n-1)*... *2 *1For example, 10! = 10 *9 ...*3*2*1 = 3628800, and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27. Find the sum of the digits in the number 100!
Solution:
With the assistance of Wolfram Alpha, we were able to find the sum of the digits in the number 100! We entered "Find the sum of the digits in the number 100!" into WolframAlpha's solve bar. WolframAlpha then calculated the result for 100! Then WolframAlpha counted the number of 0,1,2,...,8,9s in the result of 100!.
number of 0s
30
number of 1s
15
number of 2s
19
number of 3s
10
number of 4s
10
number of 5s
14
number of 6s
19
number of 7s
7
number of 8s
14
number of 9s
20
Once the the quantity of each digit is found, the value of each digits is multiplied by the quantity to get the sum of the digits in 100!. The sum of the digits in 100! is 648. WolframAlpha Solution
Click the link below to visit the Project Euler website.
Project Euler
Project Euler Problem 17
If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage.
Solution:
We used Excel to organize and solve this Euler problem. Below is the explanation and the link to the Excel document.Numbers 1-9
First look at the sum of the number of letters in the numbers 1 through 9 because these numbers are used over and over again. This sum is 36.
Numbers 10-19
Then look at numbers 10-19. The sum of these is 70.
Numbers 20-99
For numbers 20-99 there is a pattern. Each section of ten numbers has the same prefix (for example, twenty, thirty.... before the suffix). Then multiply ten by the number of letters in each number. Add 36 for each set of ten (eight in total). The sum of numbers 20-99 is 748.
So the sum of the letters in the numbers 1-99 is 854.
Numbers 100-999
Then look at the numbers 100-999 which also have a pattern. Hundred has 7 letters, so add seven to the number of letters in the number of the hundred (for example: 200(two hundred) is 3+7=10). Then multiply that number by 100 since it will be used 100 times. Then add 3*99*9, this value accounts for the three letters in the word "and" for the numbers 101-999 without counting 200, 300, 400, 500, 600, 700, 800, and 900. Then add 854*9 to account for the numbers 1-99 in each of the 9 hundreds that we have.
So for example, 100-199 the total is 2151 letters which comes from (7+3)*100 (the hundreds column)+3*99 (the "ands")+854 (the ones and tens column). Do this same process for all of the hundreds and add them together to get 20259. Then add that to the previous 854 (numbers 1-99) to get 21113. For the last number,1000, add 11 letters to the running total which gives you 21,124.
Final total of letters in the numbers 1 to 1000 is 21,124.
Solved by 43,849
Project Euler Problem 20
Find the sum of the digits in the number 100!
Solution:
With the assistance of Wolfram Alpha, we were able to find the sum of the digits in the number 100!We entered "Find the sum of the digits in the number 100!" into WolframAlpha's solve bar. WolframAlpha then calculated the result for 100!
Then WolframAlpha counted the number of 0,1,2,...,8,9s in the result of 100!.
The sum of the digits in 100! is 648.
WolframAlpha Solution
Solved by 66,466
Project Euler Problem 48
Solution:
To solve this Euler problem, we again used WolframAlpha. We entered "Sum((i^i),i=1,1000)" into the solve bar of WolframAlpha.After WolframAlpha calculated the above sum, we simple counted the last ten digits of the solution.
WolframAlpha Solution
Solved by 43,293
Sum of "solved by": 153,608
Back to home